<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns=" http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>忘记密码 - 77代购</title>
    <link href="<?php echo $this->url->getBaseUri() ?>public/front/templates/default/css/forgotPassword.css" rel="stylesheet"   type="text/css" />
    <link type="text/css" rel="stylesheet" href="<?php echo $this->url->getBaseUri() ?>public/front/templates/default/css/NewTopFoot.css"  />
    <script src="<?php echo $this->url->getBaseUri() ?>public/front/templates/default/js/jquery-1.3.2.min.js" type="text/javascript"></script>
    <script src="<?php echo $this->url->getBaseUri() ?>public/front/templates/default/js/Gobal.js" type="text/javascript"></script>
    <script type="text/javascript" src="<?php echo $this->url->getBaseUri() ?>public/front/templates/default/js/forgot_one.js"></script>
<script>

function getverifycode() {
var phonenum = $.trim($("#phone").val());
$.ajax({
type: "POST",
url: "/ajax/user_ajax.php?action=getverifycode&phone=" + phonenum,
dataType: "json",
contentType: "application/json;utf-8",
data: "{'phone':'" + phonenum + "'}",
timeout: 5000,
error: function(a, b, c) { checkcodechecked = true; },
success: function(msg) {
if (msg=="OK") {

}
else {
alert(msg);
}
}
});

}


function phoneblur(dom) {
var phone = $(dom).val();
if ($.trim(phone).length <= 0) { $(dom).attr("class", "").val("").next("p").attr("class", ""); }
else {
        var reg = new RegExp("^6\\d{10}");
        if (reg.test($(dom).val())) {
$.ajax({
                type: "POST",
                url: "/ajax/user_ajax.php?action=checkphoneown",
                dataType: "json",
                contentType: "application/json;utf-8",
                data: "{'phone':'" + phone + "'}",
                timeout: 10000,
                error: function(a, b, c) {  $(dom).attr("class", "").next("p").attr("class", ""); },
                success: function(msg) {
//alert(msg);
if(msg=="OK")
{
$(dom).attr("class", "").next("p").attr("class", "").text("");
$("#getcode").attr("style","margin-left:10px;height:30px;width:90px;float:left;display:block");
}
else
{
$(dom).attr("class", "wrong").next("p").attr("class", "red").text(msg);
$("#getcode").attr("style","margin-left:10px;height:30px;width:90px;float:left;display:none");
}
                }
            });
        }
        else {
            $(dom).attr("class", "wrong").next("p").attr("class", "red").text("此服务只提供给马来西亚电话。");
$("#getcode").attr("style","margin-left:10px;height:30px;width:90px;float:left;display:none");
        }
    }
}
</script>
<script type="text/javascript"> 
var timer = null;
var i = 60;
function aa(){
$('#getcode').removeAttr('disabled').css('cursor','pointer');
}
function bb(){
$('#getcode').html('稍等'+i+'秒');
i--;
if(i<0){
$('#getcode').html('获取验证码');
clearInterval(timer);
i=5;
}
}
$(function(){
$('#getcode').click(function(){
$(this).attr('disabled','disabled').css('cursor','default');
bb();
clearInterval(timer);
timer=setInterval('bb()',1000);
setTimeout("aa()",1000*60);
})
})
</script> 
</head>

<body>
    <form name="resetp" method="post" action="user.php?action=resetp" id="resetp">
<input type="hidden" name="commit" value="1"/>

<script type="text/javascript" src="<?php echo $this->url->getBaseUri() ?>public/front/templates/default/js/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="<?php echo $this->url->getBaseUri() ?>public/front/js/colorbox/jquery.colorbox.js"></script>
<link rel="stylesheet" media="all" type="text/css" href="<?php echo $this->url->getBaseUri() ?>public/front/js/colorbox/colorbox.css" />
<?php $this->partial('common/banner');?>
    <div class="center">
        
        <div class="xiugai">
            <table style="margin-top:30px">
                
                <tr>

                    <td class="z">
                        手机号码：
                    </td>
                    <td>
                        <input id="phone" name="phone" value=""  onblur="phoneblur(this)" type="text" placeholder="60127798800"/>
                        <p></p>
  
<button type="button" id="getcode" onclick="getverifycode()" name=""style="margin-left:10px;height:30px;width:90px;float:left;display:none">获取验证码 </button>
                    </td>
                </tr>

                
                <tr>
                    <td class="z">
                        验证码：
                    </td>
                    <td>
                        <input name="forgotCode" id="forgotCode" type="text" />
                        
                    </td>

                </tr>
                <tr>
                    <td class="z">
                        设定密码：
                    </td>
                    <td>
                        <input name="newpass" id="newpass" type="password" />
                        
                    </td>

                </tr>
<tr>
                    <td class="z">
                        确定设定密码：
                    </td>
                    <td>
                        <input name="renewpass" id="renewpass" type="password" />
                        
                    </td>

                </tr>
            </table>
            <div class="tijiao">
                <input class="button" name="" type="button" id="getcode" onclick="resetp.submit()" value="重设密码!" onmouseover="this.className='button_'"
                    onmouseout="this.className='button'" />
            </div>
        </div>
        <div class="wenxin">
            <a href="<?php echo $this->url->getBaseUri() ?>Register/index">创建一个新的帐户</a>
        </div>

        <div class="yj">
        </div>
    </div>
    </form>
    <?php $this->partial('common/bottom');?>
</body>
</html>
